<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title th:replace="common/base::pagetitle"></title>
	<link th:replace="common/base::static"/>
</head>
<body>

<div class="layui-row">
	<!-- 主要内容块 -->
	<div class="layui-form" style="padding: 20px 30px 0 0;">
		<div class="layui-form-item">
			<label class="layui-form-label">机构名称</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="name" th:value="${creditCoreBankInfo.compName}" lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">组织代码</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="comCerNo" th:value="${creditCoreBankInfo.comCerNo}" lay-verify="required"  autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">公司地址</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="comAddress" th:value="${creditCoreBankInfo.comAddress}" lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">管理人姓名</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="admName" th:value="${creditCoreBankInfo.admName}" lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">管理人手机号</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="admMobPhone" th:value="${creditCoreBankInfo.admMobPhone}" lay-verify="required"  autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">税务登记号</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="registrationNo" th:value="${creditCoreBankInfo.registrationNo}" lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">公司成立日期</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="setupDate" th:value="${creditCoreBankInfo.setupDate}" lay-verify="required"  autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">注册资金</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="registryAmount" th:value="${creditCoreBankInfo.registryAmount}" lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">银行卡号</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="bankNo" th:value="${creditCoreBankInfo.bankNo}" lay-verify="required"autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">企业法人</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="legalName" th:value="${creditCoreBankInfo.legalName}" lay-verify="required"autocomplete="off" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">法人证件号</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="legalNo" th:value="${creditCoreBankInfo.legalNo}" lay-verify="required"autocomplete="off" class="layui-input">
			</div>
		</div>


		<div class="layui-form-item">
			<label class="layui-form-label">经营范围（多个用逗号隔开）</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="businessScope" th:value="${creditCoreBankInfo.businessScope}" lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">在职人数</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="payrolls" th:value="${creditCoreBankInfo.payrolls}" lay-verify="required" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">年销售额</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="text" name="businessSalesAmount" th:value="${creditCoreBankInfo.businessSalesAmount}" lay-verify="required"  autocomplete="off" class="layui-input">
			</div>
		</div>

		<!--    <div class="layui-form-item layui-hide">-->
		<!--        <input type="button" lay-submit="" lay-filter="kFormSubmit" id="kFormSubmit" value="确认添加">-->
		<!--        <input type="text" name="id" th:value="${editInfo.id}" placeholder="保存ID" autocomplete="off" class="layui-input">-->
		<!--        <input type="text" name="parentId" th:value="${editInfo.parentId}" placeholder="保存parentId" autocomplete="off" class="layui-input">-->
		<!--    </div>-->
	</div>
</div>

<div class="layui-row" th:style="${type == 1 && status=='0'?'display: none;':''}">
	<div class="layui-form layui-form-pane"  style="padding: 20px 30px 0 0;">
		<div class="layui-form-item" pane>
			<label class="layui-form-label">是否通过</label>
			<div class="layui-input-block" id="typeRadio">
				<input lay-verify="otherReq" th:disabled="${type == 1}" type="radio" name="status" value="1"  th:checked="${status!=null && status=='1' || status==4}" title="通过" autocomplete="off" class="layui-input" >
				<input lay-verify="otherReq" th:disabled="${type == 1}" type="radio" name="status" value="2"  th:checked="${status!=null && status=='2' || status==5}" title="拒绝" autocomplete="off" class="layui-input" >
			</div>
		</div>

		<div class="layui-form-item" >
			<label class="layui-form-label">审核建议</label>
			<div class="layui-input-inline">
				<textarea class="layui-textarea" th:disabled="${type == 1}" style="height: 300px" type="text" name="remark"  lay-verify="required" placeholder="审核建议" autocomplete="off" th:text="${remark}"></textarea>
				<input type="hidden" name="supplierId"   id="supplierId" th:value="${supplierId}" placeholder="供应商id" autocomplete="off" class="layui-input">
				<input type="hidden" name="auditId" id="auditId" th:value="${auditId}" placeholder="主键id" autocomplete="off" class="layui-input">
			</div>
		</div>
		<!--	<div class="layui-form-item">-->
		<!--		<label class="layui-form-label">营业执照</label>-->
		<!--		<div class="layui-input-inline">-->
		<!--			<input type="text" name="busLicImageUrl" th:value="${editInfo.busLicImageUrl}" lay-verify="required" placeholder="请输入营业执照" autocomplete="off" class="layui-input">-->
		<!--		</div>-->
		<!--	</div>-->
		<div class="layui-form-item layui-hide">
			<input type="button" lay-submit="" lay-filter="kFormSubmit" id="kFormSubmit" value="确认添加">
<!--					  <input type="text" name="id" th:value="${editInfo.id}" placeholder="保存ID" autocomplete="off" class="layui-input">-->
<!--					  <input type="text" name="parentId" th:value="${editInfo.parentId}" placeholder="保存parentId" autocomplete="off" class="layui-input">-->
		</div>
	</div>
</div>


<script th:replace="common/base::context"></script>
<script th:replace="common/base::mainjs"></script>
<script type="text/javascript" th:inline="none">

	layui.use(['form'], function () {
		var $ = layui.$, form = layui.form;

		//自定义验证规则
		form.verify({
			otherReq: function(value,item){
				var $ = layui.$;
				var verifyName=$(item).attr('name')
						, verifyType=$(item).attr('type')
						,formElem=$(item).parents('.layui-form')//获取当前所在的form元素，如果存在的话
						,verifyElem=formElem.find('input[name='+verifyName+']')//获取需要校验的元素
						,isTrue= verifyElem.is(':checked')//是否命中校验
						,focusElem = verifyElem.next().find('i.layui-icon');//焦点元素
				if(!isTrue || !value){
					//定位焦点
					focusElem.css(verifyType=='radio'?{"color":"#FF5722"}:{"border-color":"#FF5722"});
					//对非输入框设置焦点
					focusElem.first().attr("tabIndex","1").css("outline","0").blur(function() {
						focusElem.css(verifyType=='radio'?{"color":""}:{"border-color":""});
					}).focus();
					return '必填项不能为空';
				}
			}
		});


		//监听提交
		form.on('submit(kFormSubmit)', function (data) {
			var field = data.field; //获取提交的字段
			var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引

			log('field=', field);

			//提交 Ajax 成功后，关闭当前弹层并重载表格
			$.ajax({
				type: req.type.post,
				url: api.credit.creditAudit,
				data: field,
				async: false,
				success: function (r) {
					if (r.code === req.status.ok) {
						// 重载kContentTable表格
						parent.layui.table.reload('kContentTable'); //重载表格
						parent.layer.close(index); //再执行关闭
					} else {
						wlbKit.errorMsg(r.msg);
					}
				}
			});

		});

	})
</script>
</body>
</html>
